package com.hc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自动配置类
 */
@Configuration
@EnableConfigurationProperties(CustomProperties.class)
@ConditionalOnMissingBean(CustomService.class)
public class CustomAutoConfigure {
    @Autowired
    CustomProperties customProperties;

    @Bean
    public CustomService getCustomService(){
        return new CustomService(customProperties);
    }
}
